<?php

namespace app\membercall\controller;

/** 控制器类引入区 **/
use app\common\controller\Smscm;

/** 模型类引入区 **/
use app\common\model\Project as ProjectM;
use app\common\model\ProjectCategory;

/** 核心或第三方类引入区 **/

use my\Wx;
use think\Db;
use think\Validate;

/**
 * 商品控制器
 * @package app\api\controller
 */
class Project extends Home
{
    public $noNeedLogin = [];

    /**
     * 获取项目分类
     */
    public function cateLists(){
        if ($this->request->isPost()) {
            $categoryM = new ProjectCategory();
            $result = $categoryM->getProjectCate($this->userInfo['store_id']);
            $this->result('', $result, 200);
        }
        $this->result('无效的请求方式', '', 204);
    }



    /**
     * 获取项目列表
     */
    public function lists(){
        if ($this->request->isPost()) {
            $getData = $this->request->post();
            if(empty($getData['cate_id']) || empty($getData['limit'])){
                $this->result('缺少参数', '', 204);
            }
            $categoryM = new \app\common\model\Project();
            $result = $categoryM->getProjectList($this->userInfo['store_id'],$getData['cate_id'],'0','0','0','',$getData['limit'],'0');
            $this->result('', $result, 200);
        }
        $this->result('无效的请求方式', '', 204);
    }

}
